<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>订单快递打印页面 - {$site_name}</title>
<script type="text/javascript" src="{$site_url}/includes/libraries/javascript/jquery.js" charset="utf-8"></script>
<link rel="shortcut icon" href="{$site_url}/favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css" media="print"> .NOPRINT{display:none;} </style>  
<style type="text/css">
body,td,td {font-size: 12px; font-family:Arial, Helvetica, sans-serif}
body {margin-left: 0px;	margin-top: 0px;margin-right: 0px;margin-bottom: 0px;}
.content { width:680px; margin:0 auto; overflow:hidden}
.NOPRINT { font-family:"宋体"; line-height:120%}
.order_info {margin-bottom:20px;border-bottom:1px #333 solid;}
.order_info td{ padding:3px;}
.order_info .td1{ width:300px;}.order_info .td2{ width:394px;}
.order_css {border-top:1px #333 solid;border-right:1px #333 solid;}
.order_css td{ border-left:1px #333 solid;border-bottom:1px #333 solid; padding:3px;}
.head{ width:100%;border-bottom:1px #999 solid; padding:5px 0; overflow:hidden}
.left{ float:left;}
.right{ float:right;}
.address { width:760px; margin:0 auto;text-align:left; border:1px #CCC solid; padding:3px;}
.address .h3{ font-size:13px; font-weight:bold;overflow:hidden}
.print{ margin:5px auto; position:relative;overflow:hidden}
.print input { border:0; font-size:13px; height:18px; line-height:18px}
.absolute { position:absolute}
</style>
</head>
<body>
<div align="center" style="padding:5px;" class="NOPRINT">
<select name="selxi" id="selxi" onChange="Javascript:location.href='index.php?app=kuozhan&act=OrderPrint&ordertext={$ordertext}&select='+this.options[this.selectedIndex].value">
<option value="a4" {if $smarty.get.select eq 'a4'}selected{/if}>打印_A4纸张页面</option>
<option value="express" {if $smarty.get.select eq 'express'}selected{/if}>打印_顺风快递</option>
<option value="ytsd" {if $smarty.get.select eq 'ems'}selected{/if}>打印_圆通速递</option>
<option value="ems" {if $smarty.get.select eq 'ems'}selected{/if}>打印_EMS快速</option>
<option value="zjs" {if $smarty.get.select eq 'zjs'}selected{/if}>打印_宅急送</option>
</select>&nbsp;
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0 VIEWASTEXT></OBJECT>   
  <input type=button value="直接打印" onclick="javascript:window.print();" class="NOPRINT">
  <input type=button value="页面设置" onclick="document.all.WebBrowser.ExecWB(8,1)" class="NOPRINT">
  <input type=button value="打印预览" onclick="document.all.WebBrowser.ExecWB(7,1)" class="NOPRINT">
</div>

<!--{if $smarty.get.select && $smarty.get.select neq 'a4' }-->
  <div class="address NOPRINT">
      <div class="h3">
      打印方式：<label><input name="print" type="radio" value="hb" onClick="location.href='index.php?app=kuozhan&act=OrderPrint&ordertext={$ordertext}&select={$smarty.get.select}&print=hb'" checked/>合并订单快递打印</label>
      <label><input type="radio"name="print" value="fy" onClick="location.href='index.php?app=kuozhan&act=OrderPrint&ordertext={$ordertext}&select={$smarty.get.select}&print=fy'" {if $smarty.get.print eq 'fy'}checked{/if}/>分页订单快递打印</label>
      </div>
      <!--{if $smarty.get.print neq 'fy' }-->
      <fieldset><legend>寄件人信息</legend>
      <!--{foreach from=$order_info name=key1 item=sender}-->
      <label><input type="radio" name="send_options" value="{$sender.order_id}" {if $smarty.foreach.key1.iteration == 1}checked{/if}/>寄件人姓名：{$sender.owner_name|escape}，{$sender.store_name|escape}，{$sender.tel}&nbsp;{$sender.return_address|escape}</label><br />
      <!--{/foreach}-->
      </fieldset>      
      <fieldset><legend>收件人信息</legend>
      <!--{foreach from=$order_info name=keys item=address}-->
      <label><input type="radio" name="address_options" value="{$address.region_id}" {if $smarty.foreach.keys.iteration == 1}checked{/if}/>收件人姓名：{$address.consignee|escape}{if $address.phone_mob}，{$address.phone_mob}{/if}{if $address.phone_tel}，{$address.phone_tel}{/if}&nbsp;
      {$address.region_name|escape}-{$address.address|escape}</label><br />
      <!--{/foreach}-->
      </fieldset>
      <!--{/if}-->
  </div>
<script type="text/javascript">
  var data_send = {$data_send};
  var addresses = {$data_address};
</script>  
  <!--{if $smarty.get.print neq 'fy' }-->
	  <script type="text/javascript">
		$(function(){
			$("#quantity").val({$data_info.quantity_total});
			$("#quantity2").val({$data_info.quantity_total});
			$("#weight").val({$data_info.weight_total});
			$("#weight2").val({$data_info.weight_total});
			$("#freight").val({$data_info.freight_total});
			$("#amount").val({$data_info.amount_total});			
			$('input[name="send_options"]').click(function(){ set_address(); });		
			$('input[name="address_options"]').click(function(){ set_address(); });				
			set_address();
		});
		function set_address(){
			var send_id = $("input[name='send_options']:checked").val();
			var addr_id = $("input[name='address_options']:checked").val();
			if(send_id > 0)
			{
				  var send_data = data_send[send_id];
				  for(ka in send_data){
					  switch(ka){
						  case 'send_company':
						  case 'send_name':
						  case 'send_address':
						  case 'send_tel':
							  $("#" + ka).val(send_data[ka]);
						  break;
					  }
				  }
			}			
			if(addr_id > 0)
			{
				  var addr_data = addresses[addr_id];
				  for(k in addr_data){
					  switch(k){
						  case 'consignee':
						  case 'address':
						  case 'zipcode':
						  case 'phone_tel':
							  $("#" + k).val(addr_data[k]);
						  break;
					  }
				  }
			}
		}	  
      </script>    
      <!--{if $smarty.get.select eq "express"}--> <!--=========================express=========================-->
      <?php require("data/files/mall/print/express.html"); ?>
      <!--{elseif $smarty.get.select eq "ems"}--> <!--=========================ems=============================-->
      <!--{elseif $smarty.get.select eq "zjs"}--> <!--=========================zjs=============================-->
      <!--{/if}-->  
  <!--{else}-->
	  <script type="text/javascript">
        $(function(){
			$('.print_model').each(function(){
				var print_id = $(this).attr('rel');//ID
				$(this).find("#quantity").val({$data_info.quantity_total});
				$(this).find("#quantity").val({$data_info.quantity_total});
				$(this).find("#quantity2").val({$data_info.quantity_total});
				$(this).find("#weight").val({$data_info.weight_total});
				$(this).find("#weight2").val({$data_info.weight_total});
				$(this).find("#freight").val({$data_info.freight_total});
				$(this).find("#amount").val({$data_info.amount_total});
				$(this).find("#send_company").val(data_send[print_id]['send_company']);
				$(this).find("#send_name").val(data_send[print_id]['send_name']);
				$(this).find("#send_address").val(data_send[print_id]['send_address']);
				$(this).find("#send_tel").val(data_send[print_id]['send_tel']);
				$(this).find("#consignee").val(addresses[print_id]['consignee']);
				$(this).find("#address").val(addresses[print_id]['address']);
				$(this).find("#zipcode").val(addresses[print_id]['zipcode']);
				$(this).find("#phone_tel").val(addresses[print_id]['phone_tel']);
			});
        });
      </script>
      <!--{foreach from=$order_info item=prints}-->
        <!--{if $smarty.get.select eq "express"}--> <!--=========================express=========================-->
        <div class="print_model" rel="{$prints.order_id}"><?php require("data/files/mall/print/express.html"); ?></div>
        <!--{elseif $smarty.get.select eq "ems"}--> <!--=========================ems=============================-->
        <!--{elseif $smarty.get.select eq "zjs"}--> <!--=========================zjs=============================-->
        <!--{/if}-->
      <!--{/foreach}-->      
  <!--{/if}-->
				
<!--{else}-->  <!--==================================================打印A4的纸张了============================================================-->
  <script type="text/javascript">
    function change_price(){
        $('.order_info').each(function(){
            var goods_amount = 0;
			$(this).find('.price').each(function(){
				var one_price = parseFloat($(this).val());
				goods_amount = parseFloat(goods_amount + one_price);
			});
			var freight = parseFloat($(this).find("#freight").val());
			if(!isNaN(goods_amount))
			{
				$(this).find("#goods_amount").html(goods_amount);
				$(this).find("#order_amount").html(goods_amount+freight);
			}else{
				$(this).find("#goods_amount").html(0);
				$(this).find("#order_amount").html(0);
			}
			$(this).find("#subtotal").html('&nbsp;');
        });
    }
  </script>
  <div class="content">
    <!--<div class="head"><div class="left"><h3>近水楼台www.moonyes.com</h3></div><div class="right">专业的服装批发网站，一手货源，共享商机！</div></div>-->
    <!--{foreach from=$order_info item=orders}-->
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="order_info">
      <tr>
        <td class="td1"><b>订单编号：</b>{$orders.order_sn}&nbsp;&nbsp;(日期{$orders.add_time|date})</td>
        <td class="td2"><b>店铺名称：</b>{$orders.seller_name}</td>
        </tr>
      <tr>
        <td class="td1"><b>客户姓名：</b>{$orders.consignee}{if $orders.phone_mob}，{$orders.phone_mob}{/if}{if $orders.phone_tel}，{$orders.phone_tel}{/if}</td>
        <td class="td2"><b>客户地址：</b>{$orders.region_name}-{$orders.address}</td>
        </tr>
      <tr>
        <td colspan="2">
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="order_css">
              <tr>
                <td>商品名称</td>
                <td align="center">编号</td>
                <td align="center">商品属性</td>
                <td align="center">单价</td>
                <td align="center">数量</td>
                <td align="center">小计</td>
              </tr>
              <!--{foreach from=$orders.order_goods item=goods}-->
              <tr>
                <td style="width:250px">{$goods.goods_name|escape}</td>
                <td align="center"><!--{if $goods.sku}-->{$goods.sku}<!--{else}-->&nbsp;<!--{/if}--></td>
                <td align="center"><!--{if $goods.sku}-->{$goods.specification|escape}<!--{else}-->&nbsp;<!--{/if}--></td>
                <td align="center" style="width:65px;"><input class="price" type="text" style="width:65px; border:0; text-align:center" value="{$goods.price}" onchange="change_price()"></td>
                <td align="center">{$goods.quantity}</td>
                <td align="center" id="subtotal">{$goods.subtotal}</td>
              </tr>
              <!--{/foreach}-->
            </table>    
      </td>
      </tr>
      <tr>
        <td colspan="2"><div class="left">{if $orders.postscript}客户留言：{$orders.postscript}{/if}</div><div style="width:100%; overflow:hidden">{if $orders.admin_genzong}管理员备注：{$orders.admin_genzong}{/if}</div><div class="right">订单总额：<font id="order_amount">{$orders.order_amount}</font>元 (货款<font id="goods_amount">{$orders.goods_amount}</font>元 + 运费{$orders.freight}元{if $orders.discount>0} - 优惠{$orders.discount}元{/if})</div>
        <input id="freight" type="hidden" value="{$orders.freight}" />
        </td>
      </tr>
    </table>
    <!--{foreachelse}-->
    <div style="width:100%; text-align:center; font-size:18px; color:#F00; line-height:250%">没有找到相应的订单信息</div>
    <!--{/foreach}-->
    <div class="NOPRINT" style="color:#666;width:100%;overflow:hidden">
    浏览器阻止此站点以不安全的方式使用ActiveX控件的解决方法。<br />
    1、打开IE选工具/Internet选项/安全 -> 自定义级别 <br />
    2、ActiveX控件自动提示 (选择启用) <br />
    3、对没有标记为安全的ActiveX控件进行初始化并执行脚本 (选择启用或者提示 )<br />
    4、下载未签名的ActiveX控件 (选择 启用)<br /> 
    5、运行ActiveX控件和插件 (选择启用或者提示)
    </div>
  </div>
<!--{/if}--> 
<p class="NOPRINT">&nbsp;</p>
</body>
</html>